// 样式重置
import 'normalize.css'
// 全局样式
import './assets/css/main.css'
import { createApp } from 'vue'
import { pinia } from '@/stores/index.js'

import App from './App.vue'
import router from './router/index.js'
import { registerGlobalComps } from '@/global/index.js'
const app = createApp(App)
import { useLoginStore, mapMenusToRoutes } from '@/stores/login/login.js'

// 注册全局组件
registerGlobalComps(app)
// 注册pinia
app.use(pinia)
// 初始化用户数据
useLoginStore().setupStoreState()
// 注册路由
mapMenusToRoutes() // 从缓存中获取
app.use(router)

app.mount('#app')
